package jsu.blogger.pojo;
import lombok.Data;
import java.sql.Timestamp;
import java.util.List;

@Data
public class BlogPostDetails extends Post {
    private Integer readCount = 0; //阅读量
    private Integer shareCount = 0;//分享量
    private Integer favoriteCount = 0;//收藏量
    private Integer dislikeCount = 0;//不喜欢
    private Integer averageReadTime = 0;//平均阅读时间
    private String blogType;//博客的类型 转载 自制
    private String originalUrl="";
    private Boolean haveCoverImage = false; //有无封面
    private String blogDescribe;//描述

    public BlogPostDetails() {}

    public BlogPostDetails(Long postId, Long userId, String title, String content, Integer postType, Timestamp createdAt, Timestamp updatedAt, Integer likesCount, Integer commentsCount,String originalUrl, List<String> tags, Integer readCount, Integer shareCount, Integer favoriteCount, Integer dislikeCount, Integer averageReadTime, String blogType, Boolean haveCoverImage, String blogDescribe) {
        super(postId, userId, title, content, postType, createdAt, updatedAt, likesCount, commentsCount, tags);
        this.originalUrl=originalUrl;
        this.readCount = readCount;
        this.shareCount = shareCount;
        this.favoriteCount = favoriteCount;
        this.dislikeCount = dislikeCount;
        this.averageReadTime = averageReadTime;
        this.blogType = blogType;
        this.haveCoverImage = haveCoverImage;
        this.blogDescribe = blogDescribe;
    }

    public String toString() {
        return  super.toString() + ", 博客详情 {阅读数: " + this.readCount + ", 分享数: " + this.shareCount + ", 收藏数: " + this.favoriteCount + ", 踩数: " + this.dislikeCount + ", 平均阅读时长: " + this.averageReadTime + "秒, 博客类型: '" + this.blogType + "', 描述:" + this.blogDescribe +"博客类型的地址: "+this.originalUrl+ ", 封面图片: '" + (this.haveCoverImage ? '有' : '无') + "'}";
    }
}
